package com.tdtxdcxm.ruralcommunity.slice;

import com.tdtxdcxm.ruralcommunity.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

public class AboutDetails extends AbilitySlice {
    Text about_details_text;
    Button ok_but;
    public void initADSComponents(){
        about_details_text = (Text) findComponentById(ResourceTable.Id_about_details_text);
        ok_but = (Button) findComponentById(ResourceTable.Id_ok_but);
        about_details_text.setText("文化乡道V2.0.0");
        about_details_text.append("\n乡村文化振兴网络社区（HarmonyOS鸿蒙）");
        about_details_text.append("\n------------------------\n");
        about_details_text.append("作者：TDTX-天地通玄\n陕西理工大学\n第二学士学位");
        about_details_text.append("\n------------------------\n");
        about_details_text.append("客户端：Java UI\n服务器端：Django 3.2\n");
        about_details_text.append("\n------------------------\n");
        about_details_text.append("[数据库]：\n客：XML键值对\n服：Mysql 8");
        ok_but.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                terminate();
            }
        });
    }

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_about_details);

        initADSComponents();
    }

    @Override
    protected void onActive() {
        super.onActive();
    }

    @Override
    protected void onInactive() {
        super.onInactive();
    }

    @Override
    protected void onForeground(Intent intent) {
        super.onForeground(intent);
    }

    @Override
    protected void onBackground() {
        super.onBackground();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}
